package cn.edu.hizee.gps.model;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author ZX
 */
public class PositionInfo implements Serializable {
    private static final long serialVersionUID = 513983537636629704L;
    private List<String> lng = new ArrayList<String>();
    private List<String> lat = new ArrayList<String>();
    private List<String> userId = new ArrayList<String>();
    private List<String> time = new ArrayList<String>();
    private String extra;
    // 0为没联系 1为联系
    private String flag = "0";

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getExtra() {
        return extra;
    }

    public void setExtra(String extra) {
        this.extra = extra;
    }

    public PositionInfo(String lng, String lat, String userId) {
        //设置日期格式
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        this.lng.add(lng);
        this.lat.add(lat);
        this.userId.add(userId);
        // new Date()为获取当前系统时间
        this.time.add(df.format(new Date()));
    }

    public PositionInfo(String lng, String lat) {
        this.lng.add(lng);
        this.lat.add(lat);
    }

    public PositionInfo() {
    }

    public List<String> getLng() {
        return lng;
    }

    public void setLng(List<String> lng) {
        this.lng = lng;
    }

    public List<String> getLat() {
        return lat;
    }

    public void setLat(List<String> lat) {
        this.lat = lat;
    }

    public List<String> getUserId() {
        return userId;
    }

    public void setUserId(List<String> userId) {
        this.userId = userId;
    }

    public List<String> getTime() {
        return time;
    }

    public void setTime(List<String> time) {
        this.time = time;
    }

    @Override
    public String toString() {
        return "PositionInfo{" +
                "lng=" + lng +
                ", lat=" + lat +
                ", userId=" + userId +
                ", time=" + time +
                '}';
    }
}
